// 函数封装

function getEle(selector) {
    return document.querySelector(selector)
}
function getEleAll(selector) {
    return document.querySelectorAll(selector)
}
/**
 * @name 获取节点
 * @description 根据传入的选择器返回需要的节点
 * @param {string} selector 
 * @returns 
 */

function getelement(selector) {
    const result = document.querySelectorAll(selector)
    if (!result || result.length === 0) {
        return console.error('获取失败')
    }
    if (result.length === 1) {
        return result[0]
    }
    return result;
}